#!/usr/bin/env python
from pympler.classtracker import ClassTracker
from pympler.classtracker_stats import Stats
import cProfile as profile

class myclass :

	def __init__(self):
		self.a = []

	def count(self,val):
		print val
		for i in range (10000000) :
			self.a.append(i**2%13)

			if i % 10000 == 0 :
				self.a = []

def main():

#	tracker = ClassTracker()
#	tracker.track_class(myclass)
#	tracker.start_periodic_snapshots(0.5)
#	tracker.stats.dump_stats('dump.stats')

	profile.runctx('cls = myclass(); cls.count(val)', globals(), {'val': 10} , filename='dump')

main()